<?php

/**
 * Class containing the AJAX scripts.
 *
 * @author Ian Clarence ian.clarence@gmail.com
 */ 
abstract class ViewResources extends Component {

    /**
     * The constructor.
     *
     * @param array $fields
     */
    public function __construct(array $fields = array()) {        
        parent::__construct($fields);
    }
    
    /**
     * Dummy function: adding resources to the array.
     * 
     * @return array
     */
    protected function resources() {
        return $this->fields;
    }
    
    /**
     * The whole process of creating an array of resources.
     * 
     * @param array $viewFields
     * @return array
     */
    public static function make($viewFields = array()) {
        $class = get_called_class();
        $object = new $class;
        return $object->resources($viewFields);
    }
    
}